package com.wanxi.controller;

import com.wanxi.entity.Result;
import com.wanxi.vo.CategoryVo;
import com.wanxi.vo.PageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @author yangjin
 * @date 2022年08月10日 15:43
 */

@RestController
@RequestMapping("/web/procate")
@Api(tags = "商品分类管理")
public class CategoryController {
    @GetMapping("/cateList")
    @ApiOperation("商品分类列表")
    public Result cateList(CategoryVo categoryVo, PageVo pageVo){

        return new Result("",0,new CategoryVo(),10,null);
    }

    @PostMapping("/addCategory")
    @ApiOperation("商品分类添加")
    public Result addCategory(@RequestBody CategoryVo categoryVo){
        return new Result("add successful",200,null,1,null);
    }

    @PostMapping("/cateUpdate")
    @ApiOperation("商品分类编辑")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "categoryId",value = "类型Id",required = true,dataType = "Integer"),
    })
    public Result cateUpdate(@RequestParam Integer categoryId,@RequestBody CategoryVo categoryVo){

        return new Result("update successful",200,null,1,null);
    }

    @PostMapping("/cateDelete")
    @ApiOperation("商品分类删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "categoryId",value = "类型Id",required = true,dataType = "Integer"),

    })
    public Result cateDelete(@RequestParam Integer categoryId){

        return new Result("delete successful",200,null,1,null);
    }

    @GetMapping("/cateFindById")
    @ApiOperation("按Id查询单条分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "categoryId",value = "类型Id",required = true,dataType = "Integer"),
    })
    public Result cateFindById(@RequestParam Integer categoryId){
        return new Result("",0,new CategoryVo(),1,null);
    }
}

